package math;

public class Interval {

    private final int min, max;
    private final String name;

    private Interval(String name, int min, int max) {
        this.name = name;
        this.min = min;
        this.max = max;
    }

    public static Interval interval(String name, int min, int max) {
        return new Interval(name, min, max);
    }

    public int getMax() {
        return max;
    }

    public int getMin() {
        return min;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name + "= [" + min + "," + max + "]";
    }
}
